package com.ujiuye.testcache.datainit;

import org.springframework.scheduling.annotation.Scheduled;

//@Component
//@EnableScheduling//可以在启动类上注解也可以在当前文件
public class TestJob {
 
    @Scheduled(cron = "0/10 * * * * ?")
    public void runfirst(){
        System.out.println("********first job is ok******");
    }
 
    @Scheduled(fixedRate = 1000 * 10)
    public void runsecend(){
        System.out.println("********second job is ok******");
    }
 
    @Scheduled(fixedDelay=1000)
    public void runThird(){
        System.out.println("********third job is ok*******");
    }
}